package com.ruoyi.job.task;

import com.ruoyi.common.redis.service.RedisService;
import com.ruoyi.job.kettle.KettleQuartz;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Component("jxjcxx")
public class Jxjcxx {
    private Logger logger = LoggerFactory.getLogger(Jxjcxx.class);

    @Autowired
    private RedisService redisService;

    public void ryNoParams() {
        logger.info("采集绩效数据开始============");

        Date date=new Date();
        SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMdd");
        String currentday=sdf.format(new Date(date.getTime()));

        String authKey = "authKey-" + currentday + "-jxxt";
        Map<String, String> map = new HashMap<String, String>();
        map.put("qmcy_path","/home/ETLitem");
        boolean bool = KettleQuartz.runKettleJob(map, "/home/ETLitem/jxxt.kjb");
        if(bool) {
            redisService.setCacheObject(authKey.toString(), "1"); //执行完成
        }

    }
}
